# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python

from cerbero.tools.libtool import LibtoolLibrary

class Recipe(recipe.Recipe):
    name = 'json-glib'
    version = '1.4.4'
    licenses = [License.LGPLv2_1Plus]
    btype = BuildType.MESON
    stype = SourceType.TARBALL
    url = 'gnome://'
    tarball_checksum = '720c5f4379513dc11fd97dc75336eb0c0d3338c53128044d9fabec4374f4bc47'
    deps = ['glib']
    patches = [# https://gitlab.gnome.org/GNOME/json-glib/merge_requests/17
               'json-glib/0001-meson-Don-t-error-with-MSVC-C4819-warning.patch']

    files_bins = ['json-glib-validate', 'json-glib-format']
    files_libs = ['libjson-glib-1.0']
    files_devel  = ['include/json-glib-1.0', 'lib/pkgconfig/json-glib-1.0.pc']
    files_typelibs = ['Json-1.0']

    def post_install (self):
        lib = LibtoolLibrary('json-glib-1.0', None, None, None, self.config.libdir,
                self.config.target_platform, deps=['gio-2.0', 'gobject-2.0', 'glib-2.0', '-lm', '-pthread'])
        lib.save()
        super().post_install()
